<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
<style>
    [v-cloak] {
        display: none;
    }
</style>
<body>
    <div id="box">
        <!-- 条件渲染有两种情况， v-if  v-else从真正意义上去删除或重新渲染，v-show只是display属性的变化 -->
        <h1 v-if="show" v-text="msg"></h1>
        <h1 v-else>{{info}}</h1>
        <h2 v-show='show'>{{msg}}</h2>
    </div>
    <script>
        const vm = new Vue({
            el: '#box',
            data: {
                msg: '过年了',
                info: '马上过年了',
                show: true
            }
        })
    </script>
</body>
</html>